export const epecBaseUrl = (process: any): string =>
  process.environment === 'production' || process.environment === 'pre'
    ? 'https://passport.epec.com'
    : process.environment === 'uat' || process.environment === 'fix'
      ? 'https://uat-passport.epec.com'
      : 'https://uat-passport.epec.com'

export const runtimeConfig = (): any => {
  const runtimeConfig = useRuntimeConfig()
  return runtimeConfig.public
}

export const gatewayBaseUrl = (process: any): string =>
  process.environment === 'production' || process.environment === 'pre'
    ? 'https://guokan.gateway.epec.com'
    : process.environment === 'uat' || process.environment === 'fix'
      ? 'https://uat-guokan-gateway.epec.com'
      : 'https://uat-guokan-gateway.epec.com'

export const callBackUrl = () => {
  // eslint-disable-next-line node/prefer-global/process
  if (process.client) {
    return window.location.origin
  }
  return ''
}

export const aesKey = (process: any): string =>
  process.environment === 'production' || process.environment === 'pre'
    ? 'KeHaLdyhmVpxLGxZ7XcLLmUy'
    : process.environment === 'uat' || process.environment === 'fix'
      ? 'QpGNZhFKT20v6zaujc3ElG3v'
      : 'QpGNZhFKT20v6zaujc3ElG3v'

export const memberBaseUrl = (process: any): string =>
  process.environment === 'production' || process.environment === 'pre'
    ? 'https://member.epec.com'
    : process.environment === 'uat' || process.environment === 'fix'
      ? 'https://uat-member.epec.com'
      : 'https://uat-member.epec.com'
